package com.kuangstudy.mapper;

import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.kuangstudy.entity.User;
import com.kuangstudy.vo.UserParamVo;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Map;


@Repository
public interface UserMapper extends  BaseMapper<User> {


    /**
     * 根据userParamVo查询对应的用户信息
     * @param userParamVo
     * @return
     */
     List<User> findUsers(UserParamVo userParamVo);

     List<Map<String,Object>> findBlogsUsers(UserParamVo userParamVo);

     int countBlogsUsers(UserParamVo userParamVo);

     // sql语句自己写，条件用mp 分页mp
     IPage<Map<String,Object>> selectUserPageMap(Page page, @Param(Constants.WRAPPER) Wrapper<User> queryWrapper);
}